m = {
    "001": "张三",
    "002": "李四",
    "003": "王五",
    "004": "赵六"
}

print(m)

# 通过key获取value
print(m.get("001"))
print(m["001"])

# 增加或者修改元素
m["005"] = "小伟"
print(m)

# 获取所有key和value
print(m.keys(), type(m.keys()))
print(m.values())

# 判断key是否存在
print("001" in m)

# 删除元素
del m["001"]
print(m)

print(type(m))

# 定义空的字典
m1 = dict()
m1["001"] = "张三"
print(m1)

# 遍历
for kv in m:
    print(kv, m[kv])

print("=" * 10)
print(m.items())
for k, v in m.items():
    print(k, v)

# 元组
k, v = ("keu", "value")
print(k, v)

m.clear()
print(m)
